import { stringify } from 'qs';
import request from '@/utils/request';

import webpath from '@/utils/webpath';



export async function selectByPrimaryKeyForProDictionarys(params = {}) {
    return request(`/${webpath}/web/api/service/prodictionarys/get?${stringify(params)}`);
}


export async function deleteByMapForProDictionarys(params = {}) {
    return request(`/${webpath}/web/api/service/prodictionarys/deleteByMap`, {
        method: 'POST',
        data: {
            ...params,
            method: 'delete',
        },
    });
}


export async function updateByMapForProDictionarys(params = {}) {
    return request(`/${webpath}/web/api/service/prodictionarys/updateByMap`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}


export async function getOneForProDictionarys(params = {}) {
    return request(`/${webpath}/web/api/service/prodictionarys/getOne`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}


//export async function queryPageForProDictionarys(params = {}) {
//  return request(`/${webpath}/web/api/service/prodictionarys/queryPage`, {
//      method: 'POST',
//      data: {
//          ...params,
//          method: 'fetch',
//      },
//  });
//}


export async function countForProDictionarys(params = {}) {
    return request(`/${webpath}/web/api/service/prodictionarys/count`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function insertBatchForProDictionarys(params = {}) {
    return request(`/${webpath}/web/api/service/prodictionarys/insertBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}


export async function deleteBatchForProDictionarys(params = {}) {
    return request(`/${webpath}/web/api/service/prodictionarys/deleteBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'delete',
        },
    });
}


export async function updateBatchForProDictionarys(params = {}) {
    return request(`/${webpath}/web/api/service/prodictionarys/updateBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}


export async function queryPageForProDictionarys(params = {}) {
    return request(`/${webpath}/web/api/service/prodictionaryschildren/queryPage`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}


export async function deleteByPrimaryKeyForProDictionarys(params = {}) {
    return request(`/${webpath}/web/api/service/prodictionaryschildren/delete?${stringify(params)}`);
}


export async function updateForProDictionarys(params = {}) {
    return request(`/${webpath}/web/api/service/prodictionaryschildren/update`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}


export async function insertForProDictionarys(params = {}) {
    return request(`/${webpath}/web/api/service/prodictionaryschildren/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}


export async function getAllForProDictionarysType(params = {}) {
    return request(`/${webpath}/web/api/service/prodictionarys/getAll`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getAllChildren(params = {}) {
    return request(`/${webpath}/web/api/service/prodictionaryschildren/getAllChildren`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}



export async function deleteByPrimaryKeyForProDictionarysType(params = {}) {
    return request(`/${webpath}/web/api/service/prodictionarys/delete?${stringify(params)}`);
}


export async function updateForProDictionarysType(params = {}) {
    return request(`/${webpath}/web/api/service/prodictionarys/update`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}


export async function insertForProDictionarysType(params = {}) {
    return request(`/${webpath}/web/api/service/prodictionarys/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}